// PatchSample.h: interface for the CPatchSample class.
//
//////////////////////////////////////////////////////////////////////

#ifndef PATCH_SAMPLE_H
#define PATCH_SAMPLE_H

#include "ASample.h"
#include "ItgImage.h"
#include "HarrFeatures.h"

class CPatchSample : public CASample  
{
public:
	CPatchSample();
	virtual ~CPatchSample();
	void Clear();
	void ClearImage();

	// bool LoadImage(const char *strFileName); Jiadi Yang
	void SetImages(Raster<uchar> *psrc, McItgImage *pitg);

	inline void SetHarrFeatures(CHarrFeatures *phrs){m_pHarrs = phrs;};
	inline void SetRect(irmm_Rect &rect)
	{
		m_rect = rect;
		h = m_rect.Height();
		w = m_rect.Width();
	};

	irmm_Rect GetRect(){return m_rect;};

	int		GetFeatures(vfloat &vfFeatures, vfeaid &vFeaID);
	double	GetHarrFeature(CHarrFeature &hr);

private:
	irmm_Rect		m_rect;
	bool			m_bNew;
	vfloat			m_vfSTD;
	vfloat			m_vfMean;
	Raster<uchar>*	m_pimgsrc;
	McItgImage*		m_pimgitg;
	CHarrFeatures*	m_pHarrs;

	int				h,w;
	float			m,s;
};

#endif
